package com.oamic.sdk.picker.pickerview.entity;

import android.os.Build;
import android.support.annotation.RequiresApi;
import android.text.TextUtils;

import com.oamic.sdk.picker.wheelview.interfaces.IPickerViewData;

import java.util.Objects;

public class DayModel implements IPickerViewData {
    
    private int year;
    
    private int month;
    
    private int day;
    private String label;
    
    public DayModel(int year, int month, int day,String label) {
        this.year = year;
        this.month = month;
        this.day = day;
        this.label = label;
    }
    
    public DayModel(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }
    
    public String getLabel() {
        return label;
    }
    
    public DayModel setLabel(String label) {
        this.label = label;
        return this;
    }
    
    public int getYear() {
        return year;
    }
    
    public void setYear(int year) {
        this.year = year;
    }
    
    public int getMonth() {
        return month;
    }
    
    public void setMonth(int month) {
        this.month = month;
    }
    
    public int getDay() {
        return day;
    }
    
    public void setDay(int day) {
        this.day = day;
    }
    
    @Override
    public String getPickerViewText() {
        return label;
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DayModel dayModel = (DayModel) o;
        return year == dayModel.year && month == dayModel.month && day == dayModel.day;
    }
    
    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public int hashCode() {
        return (year + "-" + month + "-" + day).hashCode();
    }
}
